﻿#pragma once

#include <functional>
#include <Global.h>
#include "UIUtilsExport.h"

namespace Domy {

typedef std::function<void(ActionKey, bool)> ActionEnableCtrl;

class WindowInterface
{
public:
    explicit WindowInterface(ActionEnableCtrl ctrl) : m_act_ctrl(ctrl) {}
    virtual ~WindowInterface() {}

    /**
     * @brief doAction
     * @note  触发动作
     */
    virtual void doAction(ActionKey key) = 0;

    /**
     * @brief setActionEnableController
     * @note  设置action使能控制器
     */
    inline void setActionEnableController(ActionEnableCtrl ctrl)
    {
        m_act_ctrl = ctrl;
    }

protected:
    ActionEnableCtrl m_act_ctrl;
};

} // namespace Domy
